% Runs Naive Bayes on CV set

% Train on mini set
YminiK = bsxfun(@eq, YcvTrain, [1 2 4 5]);
nbMini = nb_train_pk([XcvTrain]'>0, [YminiK]);

% Test
Yhat_mini = nb_test_pk(nbMini,XcvTest'>0);
ratings = [1 2 4 5];

% Calculated Expected Value
Yhat_mini = sum(bsxfun(@times, Yhat_mini, ratings),2);

% Calc RMSE
n = numel (YcvTest);
rmseMini = sqrt (sum ((YcvTest - Yhat_mini) .^ 2) / n);

